package com.lagou.edu.mapper;

import com.lagou.edu.dao.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @Classname IUserMapper
 * @Date 2021/5/30 16:49
 * @Author ch'ien
 */

@Repository
public interface ITokenMapper {

    @Insert("insert into lagou_token (email, token) value (" +
            " #{email},#{token} )")
    int save(@Param("email") String email, @Param("token") String token);


    @Select("select email from lagou_token where token = #{token} order by id desc limit 1")
    String getOne(String token);
}
